package com.diablo.commonsite.controller;

import com.diablo.commonsite.dao.ArticleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by diablo13064 on 2018/5/29.
 */
@Controller
@RequestMapping("/blog")
public class BlogPageController {

    //主页
    @RequestMapping("/index")
    public String index(ModelMap modelMap) {
        modelMap.addAttribute("articleList","");
        return "blog/index";
    }
    //登陆页
    @RequestMapping("/logpage")
    public String logpage() {
        return "blog/log";
    }
    //详细
    @RequestMapping("/{tag}/{id}")
    public String viewArticle(@PathVariable("tag") int tag, @PathVariable("id") Long id) {
        return "blog/article";
    }
    //详细样
    @RequestMapping("/article")
    public String testArticle() {
        return "blog/article";
    }
    //归类
    @RequestMapping("/timeline")
    public String timeLine() {
        return "blog/timeline";
    }

    @RequestMapping("/{tag}/{articleId}")
    public String testDetail(ModelMap modelMap,@PathVariable("tag") String tag,@PathVariable("articleId") Long articleId) {

        return "";
    }
}
